import http from '@/utils/request'

const apiBefore = '/web/attendance'

export const attendance = {
  changeUserLogStatusApi: params => {
    return http.post(`${apiBefore}/attendance/log`, params)
  },
  getUserChangeStatusListApi: params => {
    return http.get(`${apiBefore}/attendance/findCurrentDayLog`, { params }, { cache: { enable: false } })
  },
  getUserStatusListApi: params => {
    return http.get(`${apiBefore}/attendance/findTenantLog`, { params })
  },
  getTeamListForUserStatusApi: params => {
    return http.get(`${apiBefore}/attendance/findTeam`, { params })
  },
  updateTimeEntryApi: params => {
    return http.post(`${apiBefore}/tenantattendancesapprove/updatemodify`, params)
  },
  getRecordListApi: params => {
    return http.get(`${apiBefore}/attendance/findByParam`, { params })
  },
  approveTimeEntryApi: params => {
    return http.post(`${apiBefore}/tenantattendancesapprove/updateapprove`, params)
  },
  getAttendanceIdelReport: params => {
    return http.post(`${apiBefore}/attendance/idle-tickets/idleTicketsList`, params, { headers: { 'content-type': 'application/json' } })
  },
  getManagerListApi: params => {
    return http.get(`${apiBefore}/attendance/findManager`, { params: params })
  }
}
